package com.nt.redisdemo.nt.service.impl;

import com.nt.redisdemo.nt.service.EasyExcelService;
import org.springframework.stereotype.Service;

@Service
public class EasyExcelServiceImpl implements EasyExcelService {

    @Override
    public String easyExcelTest() {
        return "";
    }

//    public static<T> void writeExcelSheet(ExcelWriter excelwriter, Class<T> claszz, Map<Integer,String[]> selectMap,
//                                          List<List<T>> datalists, List<String> sheetNames){
//
//        String fileName = "output.xlsx";
//        ExcelWriter excelWriter = EasyExcel.write(fileName).build();  // 无模板
//// 或指定数据模型类（自动生成表头）
//        ExcelWriter excelWriter = EasyExcel.write(fileName, Student.class).build();
//
//        int no = 0;
//        for (List<T> list : datalists) {
//            WriteSheet writeSheet = EasyExcel.writerSheet(no, sheetNames.get(no)).head(claszz)
//                    .registerWriteHandler(new TitleSelectHandler(selectMap)).build();
//            excelwriter.write(list,writeSheet);
//            no++;
//        }
//        excelwriter.finish();
//    }
}
